package com.jsh.erp.cloud.api;

import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.service.supplier.SupplierService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController
@RequestMapping("/api/supplier")
public class SupplierApi {
    @Resource
    private SupplierService supplierService;

    @GetMapping("/getSupplier/{id}")
    public Supplier getSupplier(@PathVariable Long id)throws Exception {
        return supplierService.getSupplier(id);
    }

    @GetMapping("/updateAdvanceIn")
    public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn) throws Exception {
        return supplierService.updateAdvanceIn(supplierId, advanceIn);
    }
}
